<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>

<script>
    function $(id) {
        return document.getElementById(id);
    }

    function findByItem(pg) {
        $("pageNO").value = pg;
        $("f1").submit();
    }

</script>
<body>
查询<br>
<form action="/employee/findByItem" id="f1">
    <input type="hidden" name="pageNO" id="pageNO">
    职位：<input type="text" name="position" th:value="${position}">
    最低工资：<input type="number" name="minSalary" th:value="${minSalary}">
    最高工资： <input type="number" name="maxSalary" th:value="${maxSalary}">
    <input type="submit" value="查询">
</form>

<table border="1" width="60%">
    <thead>
    <tr>
        <th>编号</th>
        <th>姓名</th>
        <th>职位</th>
        <th>工资</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="em:${ipage.records}">
        <td th:text="${em.emId}"></td>
        <td th:text="${em.name}"></td>
        <td th:text="${em.position}"></td>
        <td th:text="${em.salary}"></td>
        <td>
            <a th:href="@{/employee/findById(id=${em.emId})}">修改</a>
            <a th:href="@{/employee/del(id=${em.emId})}">删除</a>
        </td>
    </tr>
    </tbody>
</table>
<a style="margin-left: 10px" th:each="i:${#numbers.sequence(1,ipage.pages)}" th:text="${i}"
   th:href="'javascript:findByItem('+${i}+')'"></a>

<div>
    添加新员工：<br>
    <form action="/employee/add">
        姓名： <input type="text" name="name"><br>
        职位： <input type="text" name="position"><br>
        工资： <input type="number" name="salary"><br>
        <input type="submit" value="添加">
    </form>
</div>
</body>


</html>